﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;

namespace BLL
{
    public class GataBaseBLL
    {
        GataBaseDAL dal = new GataBaseDAL();
        public List<Auction> GetListALL()
        {
            return dal.GetListALL();
        }
        //查询方法（类型查询）
        public List<Auction> GetListByID(int name)
        {
            return dal.GetListByID(name);
        }
        //查询方法（查询单条数据）
        public SignIn GetOneByID(SignIn info)
        {
            return dal.GetListByID().Where(a=>a.SignInName==info.SignInName && a.SignInPwd==info.SignInPwd).SingleOrDefault();
        }
        //查询方法（地址查询）
        public List<Auction> getListByAddress(int address) 
        {
            return dal.GetListByAddress(address);
        }
        //查询方法（价格查询）
        public List<Auction> GetListByOrder(int PreOne ,int PreTwo)
        {
            return dal.GetListByOrder(PreOne,PreTwo);
        }
        //查询方法（名称模糊查询）
        public List<Auction> GetListByName(string Name)
        {
            return dal.GetListByName(Name);
        }
        /// <summary>
        /// 添加方法
        /// </summary>
        /// <param name="ka"></param>
        /// <returns>bool值</returns>
        public bool ADD(SignIn ka) 
        {
            return dal.ADD(ka);
        }
        /// <summary>
        /// 修改登录状态
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public bool Update(SignIn info) 
        {
            return dal.Update(info);
        }
        /// <summary>
        /// 身份信息注册方法
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public bool Identity(UserInfo info)
        {
            return dal.Identity(info);
        }

        public bool GetLogin(SignIn info) 
        {
            return dal.GetLogin(info);
        }        
    }
}
